Search this book | Previous | Table of contents | Next

rtftohtml


The purpose of rtftohtml is to convert rich text format (RTF) files into HTML files. In a (long) sentence, your ability to use rtftohtml effectively is directly proportional to your word processor's ability to save valid RTF files, your word processor's ability to create "paragraph styles", and your ability to interpret the html-trans file that comes along with the rtftohtml distribution.

Like the XTND translators described here, the concept is a good one. Fire up your word processor and being entering text. To denote HTML markup, define paragraph styles corresponding to attributes listed in the html-trans file that comes with rtftohtml. For example, a paragraph style called "heading 1" and applied to a line of text will ultimately surround the selected text with the <H1> and </H1> tags. Similarly, a paragraph style called "address" will generate the ADDRESS tags.

After "marking up" your document with the paragraph styles from the html-trans file, save your document as an RTF file. (RTF is intended to be cross-platform file format defined my Microsoft.) Now, use rtftohtml to open and convert your RTF file. If all goes well, a new document will be created with the same name as your original, except it will have an ".html" extension. If rtftohtml encounters any pictures in your file, it will export them as a PICT file and give them a unique name. If your file contains any tables, then it will create a rudimentary table using the PRE constructs. If your file contains any simple bold, italic, or underlined text, then it will surround the characters with those formats with the bold, italics, or underline attributes, respectively. Footnotes and headers generate separate files and table of contents pages linked to the original.

The best way to use rtftohtml is to delete all the text from the included sample_styles.rtf file and save it as a stationary file in the format of your favorite RTF-compatible word processor. Unfortunately, not all word processors are going to read the file correctly (at least WordPerfect nor MacWrite Pro didn't), and consequently, all the enclosed styles don't get correctly translated or interpreted. Furthermore, rtftohtml expects to find certain styles while reading its RTF files. Specifically, if you want to create any hypertext links, then your word processor will have to support the "hidden" style, a style WordPerfect nor MacWrite Pro support.

In summary, rtftohtml is a very useful utility if you have Microsoft Word and/or if you are in hurry and you want to create an HTML document very quickly from a previously existing document that you can save as an RTF file.


Search this book | Previous | Table of contents | Next

Eric last edited this page on September 26, 1995. Please feel free to send comments.